<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta content="telephone=no,email=no" name="format-detection">
    <title>demo page</title>
    <link href="./pull-scale-banner.css" rel="stylesheet">
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        .home-banner {
            position: relative;
            height: 100px;
            padding-top: 8px;
            box-sizing: border-box;
            text-align: center;
        }
        .banner-img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100px;
            transform-origin: center top;
        }

        .top-bar {
            position: relative;
            display: flex;
            height: 32px;
            padding: 0 20px;
        }
        .top-bar-left {
            display: block;
            margin-top: 10px;
            height: 12px;
            width: 40px;
            font-size: 0;
            color: #fff;
        }

        .top-bar-left  span {
            display: inline-block;
            height: 12px;
            line-height: 12px;
            margin-right: 5px;
            vertical-align: bottom;
            font-size: 12px;
        }

        .fa-angle-down {
            vertical-align: bottom;
            line-height: 12px;
            font-size: 16px;
        }

        .top-bar-center {
            display: flex;
            width: 247px;
            height: 32px;
            margin-left: 12px;
            padding: 6px 8px;
            box-sizing: border-box;
            background-color: #fff;
            color: #ccc;
        }

        .fa-search {
            display: block;
            margin-right: 8px;
            font-size: 20px;
        }

        .fa-search input {
            width: 100%;
            border: none;
            outline: none;
            font-size: 14px;
            background-color: #fff;
        }

        .top-bar-right {
            display: block;
            width: 24px;
            height: 24px;
            margin-left: 12px;
            margin-top: 4px;
        }

        .top-bar-right img {
            display: block;
            width: 24px;
            height: 24px;
        }

        .main {
            height: 1200px;
            background-color: dodgerblue;
            color: #fff;
            text-align: center;
        }
        .main p {
            padding-top: 50px;
        }
    </style>
</head>
<body>

    <header class="home-banner">
        <img class="banner-img" src="https://via.placeholder.com/375x100">
        <div class="top-bar">
            <div class="top-bar-left">
                <span>北京</span>
                <i class="fa fa-angle-down"></i>
            </div>
            <div class="top-bar-center">
                <i class="fa fa-search"></i>
                输入搜索品牌、商品
            </div>
            <div class="top-bar-right">
                <img src="https://via.placeholder.com/24x24">
            </div>
        </div>

        <div class="pull-message">下拉进行跳转</div>
    </header>

    <section class="main">
        <p>从这里开始拖动</p>
    </section>

    <script src="./pull-scale-banner.js"></script>
    <script type="text/javascript">
        var pull = new pullScaleBanner({
            drager: '.main',
            scaler: '.banner-img'
        });
        pull.on('refresh', function () {
            console.log('refresh begin');
            setTimeout(function () {
                pull.emit('success');
            }, 100)
        });
    </script>
</body>
</html>